﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <script src="/js/header.js"></script>
    <script src="/lib/date/wdatepicker.js"></script>
</head>
<body>
    <div class="data-wrap case">
        <div class="data-tool clearfix">
            <div class="pull-left form-inline ">
            </div>
            <div class="pull-right">

                <form class="form-inline" id="formSearch" onsubmit="return false;">

                    <div class="input-group input-group-sm">
                        <div class="input-sm"><input name="autoRefresh" type="checkbox" title="10秒自动刷新" /> <label id="time" class="wd100">10秒自动刷新</label></div>
                    </div>

                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l">公司名称：</label>
                        <input class="form-control" name="companyName" type="text" autocomplete="off">
                    </div>

                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l">订单号：</label>
                        <input class="form-control" name="orderNo" type="text" autocomplete="off">
                    </div>

                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l">创建时间：</label>
                        <input id="d421" class="Wdate wd125" name="startTime" type="text" onfocus="WdatePicker({maxDate:'%y-%M-%d'})" autocomplete="off" />--<input id="d422" class="Wdate wd125 m5_l" name="endTime" type="text" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'d421\')}'})" autocomplete="off" />
                    </div>

                    <button type="button" class="btn btn-default btn-sm active" id="btnSearch"><span class="glyphicon glyphicon-search"></span> 搜索</button>
                </form>
            </div>
        </div>

        <div class="paging">
        </div>
    </div>

    <script type="text/x-dot-template" id="pgerTemplate">

        <div class="data-body data-scroll">
            <div class="data-view">
                <div class="data-div-view table-responsive">
                    <table class="table table-hover table-striped table-bordered">
                        <thead>
                            <tr>
                                <th class="t_l wd150">订单号</th>
                                <th class="t_l wd100">公司名称</th>
                                <th class="t_l wd150">中转单号</th>
                                <th class="t_l wd100">中转银行</th>
                                <th class="t_l wd125">中转名称</th>
                                <th class="t_l wd125">中转卡号</th>
                                <th class="t_r wd75">中转金额</th>
                                <th class="t_c wd130">中转时间</th>
                                <th class="t_c wd100">中转结果</th>
                                <th class="t_c wd100">通知状态</th>
                                <th class="t_c wd130">通知时间</th>
                                <th class="t_l wd100">客户姓名</th>
                                <th class="t_l wd150">客户银行</th>
                                <th class="t_l wd150">客户卡号</th>
                                <th class="t_c wd130">创建时间</th>
                            </tr>
                        </thead>
                        <tbody>
                            {{? it.tData && it.tData.length>0}}
                            {{~it.tData :item:index}}
                            <tr>
                                <td class="t_l wd150">{{= item.orderNo}}</td>
                                <td class="t_l wd100" title="{{= item.companyName }}">{{= item.companyName }}</td>
                                <td class="t_l wd150" title="{{= item.withdrawalOrderNo }}">{{= item.withdrawalOrderNo }}</td>
                                <td class="t_l wd100" title="{{= item.bankName }}">{{= item.bankName }}</td>
                                <td class="t_l wd100">{{= item.cardName }}</td>
                                <td class="t_l wd125" title="{{= FlashPay.Util.SubCardNumber(item.cardNumber) }}">{{= FlashPay.Util.SubCardNumber(item.cardNumber) }}</td>
                                <td class="t_r bold wd75">{{= item.withdrawalAmount }}</td>
                                <td class="t_c wd130">{{= item.transportDate }}</td>
                                <td class="t_c wd100">
                                    {{? item.transportStatus==1 }}
                                    <span class='bold'>未付款</span>
                                    {{?? item.transportStatus==2}}
                                    <span class='green bold'>付款成功</span>
                                    {{?? item.transportStatus==3}}
                                    <span class='red bold'>付款失败</span>
                                    {{?? item.transportStatus==4}}
                                    <span class='bold'>付款中</span> <a class="btn btn-primary btn-sm" data-confirm='"{{= item.orderNo }}" <br>确定要<span class="red">重置</span>该记录？' data-href="/Transfer/TransferCardRecordReset?orderNo={{= item.orderNo}}">重置</a>
                                    {{?? item.transportStatus==5}}
                                    <span class='bold'>取消付款</span>
                                    {{?? }}
                                    <span class='bold'>异常</span>
                                    {{? }}
                                </td>
                                <td class="t_c wd100">
                                    {{? item.noticeStatus==1 }}
                                    <span class='bold'>未通知</span>
                                    {{?? item.noticeStatus==2}}
                                    <span class='green bold'>通知成功</span>
                                    {{?? item.noticeStatus==3}}
                                    <span class='red bold'>通知失败</span>
                                    {{?? }}
                                    <span class='bold'>通知中</span>
                                    {{? }}
                                </td>
                                <td class="t_c wd130">{{= item.noticeLastDate }}</td>
                                <td class="t_l wd100">{{= item.withdrawalAccountName }}</td>
                                <td class="t_l wd150">{{= item.withdrawalBankName }}</td>
                                <td class="t_l wd150">{{= item.withdrawalCardNumber }}</td>
                                <td class="t_c wd130">{{= item.createDBDate }}</td>
                            </tr>
                            {{~}}
                            {{??}}
                            <tr class="noRecord">
                                <td colspan="15">暂无记录！</td>
                            </tr>
                            {{?}}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <!-- 必要的分页参数设置 -->
        <input type="hidden" id="TotalCount" value="{{=it.totalCount}}" />
    </script>
    <script type="text/javascript">

        var wait = 10;

        var autoRefresh = $("input[name='autoRefresh']");

        $(function () {
            $("input[name='startTime']").val(FlashPay.Util.GetDateStr(-1));
            $("input[name='endTime']").val(FlashPay.Util.GetDateStr(0));

            FlashPay.UI.DataAutoHeight();

            $("#btnSearch").click(function () {
                
                window.currentPage = null;

                doSearch();
            });

            FlashPay.UI.DoSearch();

            $(autoRefresh).change(function () {
                wait = 10;
                time();
            });
        });

        //倒时计
        function time() {
            var obj = document.getElementById("time");

            var isauto = $(autoRefresh).is(':checked');
            if (!isauto) {

                obj.innerText = "10秒自动刷新";

                return false;
            }

            if (wait == 0) {
                obj.innerText = "10秒自动刷新";
                wait = 10;

                if (isauto) {
                    setTimeout(function () { time(); }, 1000);
                }

                FlashPay.UI.DoSearch();
            } else {
                obj.innerText = wait + "秒自动刷新";
                wait--;
                setTimeout(function () { time(); }, 1000);
            }
        }

        $(document).keyup(function (event) {
            var keycode = event.which;
            if (keycode == 13) {
                FlashPay.UI.DoSearch();
            }
        });

        function Tip_success(word) {
            FlashPay.UI.Tip_success(word);
        }

        function doSearch() {

            emptyCompanyId();

            FlashPay.UI.Pager(".paging", { templateId: "pgerTemplate", pageSize: 15, ajax: { url: '/Transfer/TransferCardRecord'} });
        }
        
        function emptyCompanyId() {

            var company = $("#company").val();;

            if (FlashPay.Util.isNullOrEmptySpance(company)) {
                $("input[name='companyId']").val("");
            }
        }
    </script>
</body>
</html>